<?php
/*
 * File: MailController.php
 * Project: NewDemo
 * Created Time: 2024-05-29 11:27:52 am
 * Author: WangYuQiang && WangpeiGang (brainstormhongkong@gmail.com)
 * -----
 * Last Modified: 2024-07-17 5:01:53 pm
 * Modified By: WangYuQiang (719404171@qq.com>)
 * -----
 * Copyright (c) 2023 - 2024 成都睿創科技有限公司
 */



namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Tests\CreatesApplication;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;

class MailController extends Controller{


    /**
     * @param Request $request
     * @return array
     * 發送信息通知郵箱
     */
    public function MessageEmails($info){
        $Email = empty($info['Email']) ? 'brainstormhongkong@gmail.com' : $info['Email'];
        $flag =Mail::send('emails.Message',['info'=>$info], function ($message) use ($Email){
            $message ->to($Email)->subject('訂單通知 - ' .date('Y-m-d H:i:s'));
        });
        if(!$flag){
            return $this->success('发送邮件成功，请查收！');
        }
    }






}
